home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / wics.zip / TIMEEDT.H < prev    next >
C/C++ Source or Header  |  1993-02-08  |  2KB  |  73 lines

  1. #ifndef _TIMEEDT_H
  2. #define _TIMEEDT_H
  3.  
  4. #include <wics.h>
  5. #include <edit.h>
  6.  
  7. #pragma option -Vo-
  8. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  9. #pragma option -po-
  10. #endif
  11.  
  12. _CLASSDEF (TTimeEdit)
  13.  
  14. class TTimeEdit : public TEdit
  15. {
  16. private:
  17.     virtual const Pchar streamableName() const { return "TTimeEdit"; }
  18.  
  19. protected:
  20.     virtual LPSTR GetClassName() { return "WICSTimeEdit"; }
  21.     virtual void SetupWindow();
  22.  
  23.     virtual void WMCommand(RTMessage) = [WM_FIRST + WM_COMMAND];
  24.  
  25.     TTimeEdit(StreamableInit) : TEdit(streamableInit) {};
  26.  
  27. public:
  28.     TTimeEdit (PTWindowsObject AParent, int ResourceId, PTModule AModule = NULL);
  29.     ~TTimeEdit ();
  30.  
  31.     int  GetLineLength();
  32.     BOOL GetLine(LPSTR ATextString, int StrSize);
  33.     BOOL DeleteLine(int) { return !(BOOL) SendMessage(HWindow, WM_CLEAR, 0, 0); }
  34.  
  35.     //    Redefine the following functions to do nothing. They serve no purpose in the 
  36.     //    Date Edit control.
  37.         
  38.     BOOL CanUndo() { return FALSE; }
  39.     int  GetLineFromPos(int) { return 0; }
  40.     int  GetLineIndex(int) { return 0; }
  41.     void Scroll(int, int) { return; }
  42.     int  Search(int, LPSTR, BOOL) { return -1; }
  43.     void GetSubText(LPSTR, int, int) { return; }
  44.  
  45.     virtual void GetTime (long & lSeconds, Rint iHour, Rint iMinute, Rint iSecond);
  46.     virtual void GetHour (Rint iHour);
  47.     virtual void GetMinute (Rint iMinute);
  48.     virtual void GetSecond (Rint iSecond);
  49.     virtual void SetTime (Rint iHour, Rint iMinute, Rint iSecond);
  50.  
  51.     virtual void GetEditParams (LPDECPARMS lpep);
  52.     virtual void SetEditParams (LPDECPARMS lpep);
  53.  
  54.     static PTStreamable build();
  55.  
  56. };
  57.  
  58. inline Ripstream operator >> ( Ripstream is, RTTimeEdit cl )
  59.     { return is >> (RTStreamable )cl; }
  60. inline Ripstream operator >> ( Ripstream is, RPTTimeEdit cl )
  61.     { return is >> (RPvoid)cl; }
  62.  
  63. inline Ropstream operator << ( Ropstream os, RTTimeEdit cl )
  64.     { return os << (RTStreamable )cl; }
  65. inline Ropstream operator << ( Ropstream os, PTTimeEdit cl )
  66.     { return os << (PTStreamable )cl; }
  67.  
  68. #pragma option -Vo.
  69. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  70. #pragma option -po.
  71. #endif
  72.  
  73. #endif